<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="robots" content="nofollow,noarchive,noindex">
  <title>{{ message }}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- {{ if or (eq code 408) (eq code 425) (eq code 429) (eq code 500) (eq code 502) (eq code 503) (eq code 504) }} -->
  <meta http-equiv="refresh" content="30">
  <!-- {{ end }} -->
  <meta name="title" content="{{ code }}: {{ message | escape }}">
  <meta name="description" content="{{ description | escape }}">
  <meta property="og:title" content="{{ code }}: {{ message | escape }}">
  <meta property="og:description" content="{{ description | escape }}">
  <meta property="twitter:title" content="{{ code }}: {{ message | escape }}">
  <meta property="twitter:description" content="{{ description | escape }}">
  <style>
    :root {
      --color-primary: #fff;
      --color-inverted: #202020;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --color-primary: #000;
        --color-inverted: #fff;
      }
    }

    html, body {
      margin: 0;
      padding: 0;
      min-height: 100%;
      height: 100%;
      width: 100%;
      background-color: var(--color-primary);
      color: var(--color-inverted);
      font-family: sans-serif;
      font-size: 16px;
      word-break: keep-all;
    }

    @media screen and (min-width: 2000px) {
      html, body {
        font-size: 22px;
      }
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      height: 100%;
    }

    article img {
      width: 100%;
      max-width: 750px;
      box-shadow: 0 30px 0 -20px rgba(0, 0, 0, 0.2);
    }

    /* {{ if show_details }} */
    table.details {
      table-layout: fixed;
      width: 100%;
      opacity: .8;
      padding-top: 1.5em;
    }

    table.details td {
      white-space: nowrap;
      font-size: 0.7em;
    }

    table.details .name,
    table.details .value {
      width: 50%;
    }

    table.details .name::first-letter,
    table.details .value::first-letter {
      font-weight: bold;
    }

    table.details .name {
      text-align: right;
      padding-right: .4em;
      width: 50%;
    }

    table.details .value {
      text-align: left;
      padding-left: .4em;
      font-family: monospace;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* {{ end }} */
  </style>
</head>
<body>
<article>
  <img src="https://http.cat/{{ code }}.jpg" alt="{{ message }}">
</article>

<!-- {{- if show_details -}} -->
<table class="details">
  <tbody>
  <!-- {{- if host -}} -->
  <tr>
    <td class="name" data-l10n>Host</td>
    <td class="value">{{ host }}</td>
  </tr>
  <!-- {{- end }}{{ if original_uri -}} -->
  <tr>
    <td class="name" data-l10n>Original URI</td>
    <td class="value">{{ original_uri }}</td>
  </tr>
  <!-- {{- end }}{{ if forwarded_for -}} -->
  <tr>
    <td class="name" data-l10n>Forwarded for</td>
    <td class="value">{{ forwarded_for }}</td>
  </tr>
  <!-- {{- end }}{{ if namespace -}} -->
  <tr>
    <td class="name" data-l10n>Namespace</td>
    <td class="value">{{ namespace }}</td>
  </tr>
  <!-- {{- end }}{{ if ingress_name -}} -->
  <tr>
    <td class="name" data-l10n>Ingress name</td>
    <td class="value">{{ ingress_name }}</td>
  </tr>
  <!-- {{- end }}{{ if service_name -}} -->
  <tr>
    <td class="name" data-l10n>Service name</td>
    <td class="value">{{ service_name }}</td>
  </tr>
  <!-- {{- end }}{{ if service_port -}} -->
  <tr>
    <td class="name" data-l10n>Service port</td>
    <td class="value">{{ service_port }}</td>
  </tr>
  <!-- {{- end }}{{ if request_id -}} -->
  <tr>
    <td class="name" data-l10n>Request ID</td>
    <td class="value">{{ request_id }}</td>
  </tr>
  <!-- {{- end -}} -->
  <tr>
    <td class="name" data-l10n>Timestamp</td>
    <td class="value">{{ nowUnix }}</td>
  </tr>
  </tbody>
</table>
<!-- {{- end -}} -->

<!-- {{- if l10n_enabled -}} -->
<script>// {{ l10nScript }}</script>
<!-- {{- end -}} -->
</body>
</html>
